package ssh.ssh;

import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;

/**
 * Hello world!
 * 
 */
public class App {
	public static void main(String[] args) throws IOException {

		
		URI uri = null;
		try {
			uri = new URI("http://image.techweb.com.cn/upload/2011/1111/1320998211646.JPG");
		} catch (URISyntaxException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		File file = new File(uri);
		
		/*URL url = new URL(
				"http://image.techweb.com.cn/upload/2011/1111/1320998211646.JPG");
		HttpURLConnection connection = (HttpURLConnection) url.openConnection();

		BufferedInputStream in = new BufferedInputStream(
				connection.getInputStream());
		ByteArrayOutputStream out = new ByteArrayOutputStream(1024);

		System.out.println("Available bytes:" + in.available());

		byte[] temp = new byte[1024];
		int size = 0;
		while ((size = in.read(temp)) != -1) {
			out.write(temp, 0, size);
		}
		in.close();
		byte[] content = out.toByteArray();*/

	}

	public static void test1() {

		System.out.println(111);
		return;
	}

	public static void test2() {

		System.out.println(222);
		return;
	}
}
